package com.twu.biblioteca;

/**
 * Created by Raluca Puichilita on 03/08/2014.
 */

public class Movie {

    private String name;
    private int year;
    private String director;
    private int rating = -1;

    public Movie(String name, int year, String director, int rating) {
        this.name = name;
        this.year = year;
        this.director = director;
        this.rating = rating;
    }

    public Movie(String name, int year, String director) {
        this.name = name;
        this.year = year;
        this.director = director;
    }

    public String getName() {
        return name;
    }

    public int getYear() {
        return year;
    }

    public String getDirector() {
        return director;
    }

    public int getRating() {
        return rating;
    }

    public String toString() {
        if (rating != -1)
            return "'" + name + "'" + " (" + year + ")" + " directed by " + director + ", Rating: " + rating;
        else
            return "'" + name + "'" + " (" + year + ")" + " directed by " + director + ", Unrated";
    }
}
